#include <w32std.h>
#include "SimulateEvent.h"

void SimulateEvent::SimulateGreenKeyEvent()
	{
	TRawEvent event;
	event.Set(TRawEvent::EKeyDown, EStdKeyYes);
	imulateEvent(event);
	User::After(100000);
	event.Set(TRawEvent::EKeyUp, EStdKeyYes);
	imulateEvent(event);
	}
void SimulateEvent::SimulateRedKeyEvent()
	{
	TRawEvent event;
	event.Set(TRawEvent::EKeyDown, EStdKeyNo);
	imulateEvent(event);
	User::After(100000);
	event.Set(TRawEvent::EKeyUp, EStdKeyNo);
	imulateEvent(event);
	}
void SimulateEvent::SimulateRightKeyEvent()
	{
	TRawEvent event;
	event.Set(TRawEvent::EKeyDown, EStdKeyDevice1);
	imulateEvent(event);
	User::After(100000);
	event.Set(TRawEvent::EKeyUp, EStdKeyDevice1);
	imulateEvent(event);
	}

void SimulateEvent::imulateEvent(TRawEvent aEvent)
	{
	RWsSession ws;
	ws.Connect();
	ws.SimulateRawEvent(aEvent);
	ws.Flush();
	ws.Close();
	}
